<template>
    <div>
        <div class="m-totas">
            <div class="totas-box">
                <div class="box-head">
                    {{title || '注意'}}
                    <span @click="close()"><img src="../../../static/images/totas_close.png" alt=""></span>
                </div>
                <div class="box-content">
                    <slot></slot>
                    <div class="c-btns" v-show="!hidnbtn">
                        <span><button class="b-sure" @click="sure()">确定</button></span>
                        <span><button class="b-close" @click="close()">关闭</button></span>
                    </div>
                </div>
                
            </div>
        </div>
    </div>
</template>
<script>
export default {
    data(){
        return{

        }
    },
    props:['title','hidnbtn'],
    methods:{
        //点击关闭
        close(){
            this.$emit('totas',false);
        },
        //点击确定
        sure(){
            this.$emit('totas',true);
        },

    },
    
}
</script>
<style lang="less" scoped>
.m-totas{
    position: fixed;
    bottom: 0;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(0,0,0,0.5);
    z-index: 55;
    .totas-box{
        width: 720px;
        margin: 13% auto 0;
        border-radius: 8px;
        overflow: hidden;
        .box-head{
            height: 50px;
            line-height: 50px;
            color: #fff;
            padding-left: 30px;
            font-size: 16px;
            background: #1575F9;
            position: relative;
            font-weight: bold;
            &>span{
                position: absolute;
                right: 10px;
                font-size: 20px;
                img{
                    padding: 0 20px;
                }
            }
        }
        .box-content{
            background: #fff;
            padding: 60px 0 ;
            text-align: center;
            position: relative;
            .c-btns{
                width: 100%;
                text-align: center;
                &>span{
                    margin-right: 30px;
                    button{
                        height: 38px;
                        width: 126px;
                        text-align: center;
                        color: #fff;
                        border: none;
                        font-size: 16px;
                        border-radius: 5px;
                        &.b-sure{
                            background: #1575F9;
                        }
                        &.b-close{
                            background: #999;
                        }
                    }

                    &:last-child{
                        margin-right: 0;
                    }
                }
            }
        }
        
    }
}
</style>
